package com.xy.model;

/*
 * @移库表
 */
import java.io.Serializable;
import java.util.Date;

import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

@SuppressWarnings("serial")
@Entity
@Table
@Cacheable
public class StockMove extends Identified implements Serializable {

	@Column(nullable = false)
	private int amount;// 数量
	private String remark;// 备注
	@Column(nullable = false)
	private Date dateTime;// 移库时间
	// 对应原货架表
	@OneToOne(targetEntity = Cell.class)
	@JoinColumn(name = "OCell_id", referencedColumnName = "id")
	private Cell ocell;
	// 现货架表
	@OneToOne(targetEntity = Cell.class)
	@JoinColumn(name = "NCell_id", referencedColumnName = "id")
	private Cell ncell;
	// 对应管理员表
	@ManyToOne(targetEntity = Admin.class)
	@JoinColumn(name = "Admin_Id", referencedColumnName = "id")
	private Admin admin;
	@ManyToOne(targetEntity = TextBook.class)
	@JoinColumn(name = "textBook_Id", referencedColumnName = "id")
	private TextBook textBook;
	
	

	public TextBook getTextBook() {
		return textBook;
	}

	public void setTextBook(TextBook textBook) {
		this.textBook = textBook;
	}

	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Date getDateTime() {
		return dateTime;
	}

	public void setDateTime(Date dateTime) {
		this.dateTime = dateTime;
	}

	public Cell getOcell() {
		return ocell;
	}

	public void setOcell(Cell ocell) {
		this.ocell = ocell;
	}

	public Cell getNcell() {
		return ncell;
	}

	public void setNcell(Cell ncell) {
		this.ncell = ncell;
	}

	public Admin getAdmin() {
		return admin;
	}

	public void setAdmin(Admin admin) {
		this.admin = admin;
	}

	public StockMove() {
		super();
		// TODO Auto-generated constructor stub
	}

}
